package com.google.code.vannevar.client.ui.util;

import com.google.gwt.user.client.ui.RootPanel;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Container;

public final class Components {
    
    public static Component get(String id) {
        
        String[] ids = id.split(".");
        Component component = (Component) RootPanel.get().getWidget(0);
        
        for (int i = 0; i < ids.length - 1; i++) {
            
            component = ((Container) component).getComponent(ids[i]);
        }
        
        return ((Container) component).getComponent(ids[ids.length - 1]);
    }
}
